/* Layout */
import Layout from '@neu/biz-core/layout'
import BlankLayout from '@neu/biz-core/layout/BlankLayout'
import authRoutes from '@neu/auth-ui/router'
import cmdbRoutes from '@neu/cmdb-ui/router'

const myCmdbRoutes = cmdbRoutes.filter(it => it.path !== '/')

export default [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    meta: { code: 'dcvm_menu_dashboard_parent' },
    children: [
      {
        path: 'dashboard',
        component: () => import('@neu/dcvm-ui/views/dashboard'),
        name: 'Dashboard',
        meta: { title: '仪表盘', icon: 'dashboard', affix: true, code: 'dcvm_menu_dashboard' }
      }
    ]
  },
  {
    path: '/',
    component: BlankLayout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@neu/dcvm-ui/views/3d'),
        name: 'Dashboard',
        meta: { title: '全景视图', icon: 'dashboard', affix: true, code: 'dcvm_menu_3d_dashboard' }
      }
    ]
  },
  {
    path: '/3d',
    component: Layout,
    redirect: 'noRedirect',
    alwaysShow: true,
    meta: {
      title: '3D可视化',
      icon: 'monitor',
      module: 'dcvm',
      code: 'dcvm_menu_3d'
    },
    children: [
      {
        path: 'overall',
        name: 'dcvm_3d_overall',
        meta: { title: '全景视图', icon: 'right-arrow', affix: true, code: 'dcvm_menu_3d' },
        component: () => import('@neu/dcvm-ui/views/3d')
      }
    ]
  },
  {
    path: '/dcvm',
    name: 'dcvm',
    redirect: 'noRedirect',
    alwaysShow: true,
    meta: {
      title: '配置中心',
      icon: 'settings',
      module: 'dcvm',
      code: 'dcvm_menu_parent'
    },
    component: Layout,
    children: [
      {
        path: 'model',
        name: 'dcvm_model',
        meta: {
          title: '模具管理',
          icon: 'right-arrow',
          module: 'dcvm',
          code: 'dcvm_menu_model'
        },
        component: () => import('@neu/dcvm-ui/views/models')
      },
      {
        path: 'mock',
        name: 'dcvm_mock',
        meta: {
          title: '模拟接口',
          icon: 'right-arrow',
          module: 'dcvm',
          code: 'dcvm_menu_mock'
        },
        component: () => import('@neu/dcvm-ui/views/mocks')
      },
      {
        path: 'config',
        name: 'dcvm_config',
        meta: {
          title: '3D配置',
          icon: 'right-arrow',
          module: 'dcvm',
          code: 'dcvm_menu_config'
        },
        component: () => import('@neu/dcvm-ui/views/configs')
      },
      {
        path: 'systemTask',
        name: 'systemTask',
        meta: {
          title: '定时任务',
          icon: 'right-arrow',
          module: 'dcvm',
          code: 'dcvm_menu_systemTask'
        },
        component: () => import('@neu/dcvm-ui/views/sysTask')
      }
    ]
  },
  ...myCmdbRoutes,
  {
    path: 'databus',
    component: Layout,
    children: [
      {
        path: 'http://' + location.host + '/d',
        meta: { title: '数据采集', icon: 'link', code: 'dcvm_menu_databus' }
      }
    ]
  },
  ...authRoutes
]
